home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shw_portroomvoice.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  145 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SHW_PortRoomVoice.cog
  4. #
  5. # Say line control for the wheelcav in SHW
  6. #
  7. # [CMG]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols        
  13.     #    MESSAGES
  14.     message     startup
  15.     message     entered
  16.     
  17.     #    ACTORS
  18.     thing       player      local
  19.     thing       indyActor      
  20.           
  21.     # PROPS
  22.     thing    wheeldevice
  23.     
  24.     #    ACTOR MARKS
  25.     thing       player_mk1      
  26.  
  27.     #    TRIGGERS
  28.     surface     triggersurf     
  29.     
  30.     #    CAM OBJS
  31.     thing    campos
  32.     
  33.     #    CAM TARGS
  34.     thing    wheeltarg    local
  35.     
  36.  
  37.     # VECTORS
  38.     vector    wheeltargpos    local
  39.     
  40.     # TEMPLATES
  41.     template    camObj=ghost    local
  42.     
  43.     #    SAYLINES
  44.     sound       intheyknew=sw01j04.wav      local       # they certainly knew...
  45.     
  46.     int hit=0   local
  47.     int in_rotRate    local
  48.     int curCam    local
  49.     
  50. end
  51.  
  52. # ========================================================================================
  53.  
  54. code
  55.  
  56. startup:
  57.  
  58.     player = GetLocalPlayerThing();
  59.     return;
  60.     
  61. # ========================================================================================
  62.  
  63. entered:
  64.  
  65.     if (hit == 1) return;
  66.     if ((GetSenderRef() == triggersurf) && (GetSourceRef() == player))
  67.         {    
  68.             hit = 1;
  69.             
  70.             # Prep for scene...
  71.             StartCutScene(1);
  72.             curCam = GetCurrentCamera();
  73.             Sleep(0.25);
  74.             MakeMeStop();
  75.             SetCameraLookInterp(2, 0);
  76.             SetCameraPosInterp(2, 0);
  77.             #SetActorFlags(player, 0x200000);
  78.             Sleep(1.0);
  79.             DeselectWeapon(player); # stow any weapon or lighter
  80.             Sleep(0.5); # wait a beat
  81.             CopyPlayerHolsters(player, indyActor); # make sure actor has matching props
  82.             
  83.             # offset the cam to a known position
  84.             SetExtCamOffsetToThing(campos);
  85.             Sleep(1.0);
  86.             
  87.             # Line Indy up...
  88.             CopyOrientAndPos(player, indyActor);
  89.             SetThingFlags(player, 0x80000);
  90.             ClearThingFlags(indyActor, 0x80000);
  91.             
  92.             # goto camera 2 
  93.             SetCameraFocus(2, campos);
  94.             SetCameraSecondaryFocus(2, indyActor);
  95.             SetCurrentCamera(2);
  96.             SetCameraFOV(90, 0, 0.0);
  97.             
  98.             # move indyAcotr out to the edge
  99.             AISetLookThingEyeLevel(indyActor, player_mk1);
  100.             AISetMoveThing(indyActor, player_mk1, 1);
  101.  
  102.             # create a ghost object target for camera focaus at indyActors' position
  103.             wheeltargpos = VectorAdd(VectorTransformToOrient(indyActor, '0.0 0.0 0.0'), GetThingPos(indyActor));
  104.             wheeltarg = CreateThingAtPos(camObj, GetThingSector(indyActor), wheeltargpos, '0 0 0');
  105.             CaptureThing(wheeltarg);
  106.  
  107.             # Set camera focus to moving object
  108.             SetCameraSecondaryFocus(2, wheeltarg);
  109.             
  110.             # wait for actor to stop, set actors' look targ to wheel
  111.             AISetLookThing(indyActor, wheeldevice);
  112.             
  113.             
  114.             # offset camera look target to thing.
  115.             #SetExtCamLookOffsetToThing(wheeltarg);
  116.             
  117.             Sleep(2.0);
  118.             
  119.             # move the camera focus object down to the wheel
  120.             animId = MoveThingToPos(wheeltarg, GetThingPos(wheeldevice), 2.0);
  121.             
  122.             # Sleep breifly then say line
  123.             sleep(1.0);
  124.             PlayVoice(player, intheyknew, 1.0, 1);
  125.             Sleep(1.0);
  126.  
  127.             # Restore camera
  128.             SetCameraPosition(curCam, GetThingPos(campos));
  129.             SetCurrentCamera(curCam);
  130.             RestoreExtCam();
  131.             EndCutScene();
  132.  
  133.             # Return control and camera to player
  134.             CopyOrientAndPos(indyActor, player);
  135.             SetThingFlags(indyActor, 0x80000);
  136.             ClearThingFlags(player, 0x80000);
  137.             ClearActorFlags(player, 0x200000);
  138.         }    
  139.     return;
  140.  
  141. # ========================================================================================
  142.     
  143. end
  144.  
  145.